﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.WindowsAzure;
using Microsoft.WindowsAzure.StorageClient;

namespace AzureBlob
{
    class CloudBlobDirectoryHolder : ICloudBlobHolder
    {
        CloudBlobDirectory directory;
        public CloudBlobDirectoryHolder(CloudBlobDirectory directory)
        {
            this.directory = directory;
        }

        public Uri Uri
        {
            get { return directory.Uri; }
        }

        public CloudBlockBlob GetBlockBlobReference(string relUri)
        {
            return directory.GetBlockBlobReference(relUri);
        }

        public IEnumerable<IListBlobItem> ListBlobs()
        {
            return directory.ListBlobs();
        }
        public IAsyncResult BeginListBlobsSegmented(AsyncCallback callback, object state)
        {
            return directory.BeginListBlobsSegmented(callback, state);
        }

        public ResultSegment<IListBlobItem> EndListBlobsSegmented(IAsyncResult asyncResult)
        {
            return directory.EndListBlobsSegmented(asyncResult);
        }

        public CloudBlobDirectory GetDirectoryReference(string relativeAddress)
        {
            return directory.GetSubdirectory(relativeAddress);
        }

        public IEnumerable<IListBlobItem> ListBlobs(BlobRequestOptions options)
        {
            return directory.ListBlobs(options);
        }

        //public void Delete()
        //{
        //    throw new NotImplementedException();
        //}
    }
}
